package threaduse;

/**
 * @description:
 * @Author yyp
 * @time 2022/3/29
 */
public class ThreadMethod03 {
    public static void main(String[] args) throws InterruptedException {
        Thread03 thread03 = new Thread03();
        thread03.setDaemon(true);
        thread03.start();
        for (int i = 0; i < 10; i++) {
            Thread.sleep(500);
            System.out.println("main"+i);
        }
    }
}

class Thread03 extends Thread{
    @Override
    public void run(){
        for (;;) {
            try {
                Thread.sleep(200);
            }catch (InterruptedException e){
                e.printStackTrace();
            }
            System.out.println("thread03");
        }
    }
}